public class FP {
	public static final short FP = 16;

	public FP() {
	}

	static public long toFP(int a) {
		return (a << FP);
	}

	static public long toLong(long a) {
		return (a >> FP);
	}

	static public int toInt(long a) {
		return (int) (a >> FP);
	}

	static public short toShort(long a) {
		return (short) (a >> FP);
	}

	static public long add(long a, long b) {
		return (a + b);
	}

	static public long sub(long a, long b) {
		return (a - b);
	}

	static public long mul(long a, long b) {
		return ((a * b) >> FP);
	}

	static public long div(long a, long b) {
		return ((a << FP) / b);
	}

	static public long abs(long a) {
		return a > 0 ? a : -a;
	}
   
	static public int abs(int a) {
		return a > 0 ? a : -a;
	}
}
